using System;
using Castle.ActiveRecord;

namespace IronMis2.Models
{
    [ActiveRecord("other_out")]
    public class OtherOut:ActiveRecordBase<OtherOut>
    {
        private Guid id;
        private string otherOutId;
        private string otherOutType;
        private DateTime? otherOutDate;
        private Employee employee;
        private Storehouse storeHouse;

        [PrimaryKey(PrimaryKeyType.GuidComb,Column = "id")]
        public Guid Id
        {
            set { id = value; }
            get { return id; }
        }

        [Property(Column = "other_out_id",SqlType = "char",Length = 10)]
        public string OtherOutId
        {
            set { otherOutId = value; }
            get { return otherOutId; }
        }

        [Property(Column = "other_out_type",SqlType = "char",Length = 20)]
        public string OtherOutType
        {
            set { otherOutType = value; }
            get { return otherOutType; }
        }

        [Property(Column = "other_out_date",SqlType = "datetime",Length = 8)]
        public DateTime? OtherOutDate
        {
            set { otherOutDate = value; }
            get { return otherOutDate; }
        }

        [BelongsTo(Column = "s_number",ForeignKey = "id",Insert = true,Update = true,Fetch = FetchEnum.Select)]
        public Employee Employee
        {
            set { employee = value; }
            get { return employee; }
        }

        [BelongsTo(Column = "stor_id",ForeignKey = "id",Insert = true,Update = true,Fetch = FetchEnum.Select)]
        public Storehouse StoreHouse
        {
            set { storeHouse = value; }
            get { return storeHouse; }
        }
    }
}
